﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace BookOnline.Data
{
    class Publisher
    {
        private string _PubID;
        private string _PubName;
        private string _PubAddress;
        private string _PubPhone;

        public string PubID { get { return _PubID; } set { _PubID = value; } }
        public string PubName { get { return _PubName; } set { _PubID = _PubName; } }
        public string PubAddress { get { return _PubAddress; } set { _PubAddress = value; } }
        public string PubPhone { get { return _PubPhone; } set { _PubPhone = value; } }

        public Publisher PublisherIDataReader(IDataReader dr)
        {
            Publisher obj = new Publisher();
            obj.PubID = (dr["PubID"] is DBNull)?string.Empty:dr["PubID"].ToString();
            obj.PubName = (dr["PubName"] is DBNull) ? string.Empty : dr["PubName"].ToString();
            obj.PubAddress = (dr["PubAddress"] is DBNull) ? string.Empty : dr["PubAddress"].ToString();
            obj.PubPhone = (dr["PubPhone"] is DBNull) ? string.Empty : dr["PubPhone"].ToString();
            return obj;
        }
    }
}
